package java68_2;

import java.util.Scanner;

public class Zuhe {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int k=0;
        while(true) {
            System.out.println("请输入钱数:");
            k = in.nextInt();
            if(k>0)
                break;
        }
        //120=>9038
        //统计有多少种可能
        //代表每一种钱币的个数
        int count=0;
        int m100,m50,m20,m10,m5,m2,m1;
        for(m100=0;m100<=k/100;m100++){
            for(m50=0;m50<=(k-m100*100)/50;m50++){
                for(m20=0;m20<=(k-m100*100-m50*50)/20;m20++){
                    for(m10=0;m10<=(k-m100*100-m50*50-m20*20)/10;m10++){
                        for(m5=0;m5<=(k-m100*100-m50*50-m20*20-m10*10)/5;m5++){
                            for(m2=0;m2<=(k-m100*100-m50*50-m20*20-m10*10-m5*5)/2;m2++){
                                count++;
                                m1=k-m100*100-m50*50-m20*20-m10*10-m5*5-m2*2;

                                System.out.print(m100==0?"":m100+"张100元");
                                System.out.print(m50==0?"":m50+"张50元");
                                System.out.print(m20==0?"":m20+"张20元");
                                System.out.print(m10==0?"":m10+"张10元");
                                System.out.print(m5==0?"":m5+"张5元");
                                System.out.print(m2==0?"":m2+"张2元");
                                System.out.print(m1==0?"":m1+"张1元");
                                System.out.println();
                            }
                        }
                    }
                }
            }
        }
    }
}

